package lab02.test28;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by admin on 2017/11/13.
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("请输入半径：");
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        try{
            System.out.println("圆的面积为："+computerArea(Double.parseDouble(br.readLine())));
        }catch (NumberFormatException e){
            System.out.println("你的输入错误！");
        } catch (IOException e) {
            e.printStackTrace();

        }
    }
    public static double computerArea(double r)
    {
        return  Math.PI*r*r;
    }
}
